<?php
// 演绎者销售商 协议
$this->_extends('_layouts/partner_layout');

$this->_block('actionName'); ?>
<td align="center" background="<?php echo $_BASE_DIR; ?>images/topb.gif">
	<table width="96%" border="0" cellspacing="0" cellpadding="0">
       <tr>
<td align="left"><span class="blue14">销售商</span></td>
       </tr>
  </table>
</td>
<?php 
$this->_endblock();

$this->_block('contents');
?>
<?php if( $finish == 1 ): ?>
	<p align="center" style="color:blue;font-size:14px;">申请信息提交成功！ 请耐心等待, 审核通过后，我们的工作人员将会通知您。</p>
<?php else: //提交信息 ?>
	<table width="92%" border="0" cellspacing="0" cellpadding="0">
	    <tr>
	      <td height="30" align="center"><span class="STYLE10">填写销售商个人信息</span></td>
	    </tr>
    </table>
<table width="92%" border="0" cellspacing="0" cellpadding="0"><tr><td height="1" bgcolor="#eaeaea"></td></tr></table>
<table width="50%" border="0" cellspacing="0" cellpadding="0"><tr><td height="10"></td></tr></table>
	<?php if( !empty($error) ): ?>
<p style="color:red;font-size:13px;">错误提示: <?php echo $error; ?></p>
	<?php endif; ?>
<form id='actorForm' action="<?php echo url('partner/seller'); ?>" enctype="multipart/form-data" method="post" onsubmit='return validateSeller();'>
<input type='hidden' name='type' value='seller' />
<input type='hidden' name='kkyoo_add_seller' value='kkyoo/partner/seller/add' />
<input type='hidden' name='mark' value='create' />
            <table width="88%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="12%" height="35" align="left">真实姓名：</td>
                <td width="88%" align="left"><input class="dogmark" name="name" id='name' value="<?php echo $name; ?>" type="text" size="12" /></td>
              </tr>
              <tr>
                <td width="12%" height="35" align="left">身份证号：</td>
                <td width="88%" align="left"><input class="dogmark" id="id_card" name="id_card" value="<?php echo $id_card; ?>" type="text" size="30" 
                onkeyup="this.value=this.value.replace(/[^\x00-\xff]/g,'')" onafterpaste="this.value=this.value.replace(/[^\x00-\xff]/g,'')" /></td>
              </tr>
              <tr>
                <td width="12%" height="35" align="left">现居住地：</td>
                <td width="88%" align="left"><input class="dogmark" name="address" value="<?php echo $address; ?>" type="text" size="60" /></td>
              </tr>
              <tr>
                <td width="12%" height="35" align="left">联系电话：</td>
                <td width="88%" align="left"><input class="dogmark" name="phone" value="<?php echo $phone; ?>" type="text" size="30" 
                onkeyup="this.value=this.value.replace(/[^\x00-\xff]/g,'')" onafterpaste="this.value=this.value.replace(/[^\x00-\xff]/g,'')" /></td>
              </tr>
            </table>
            <table width="88%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="9%" height="35" align="left">K秀账号：</td>
                <td width="15%" align="left"><input class="dogmark" name="uin" value="<?php echo $uin; ?>" type="text" size="12" 
                 readonly="readonly" /></td>
                  <td width="6%" height="35" align="left">QQ号：</td>
                <td width="38%" align="left"><input class="dogmark" name="qq" value="<?php echo $qq; ?>" type="text" size="16" 
                  onkeyup="this.value=this.value.replace(/[^\x00-\xff]/g,'')" onafterpaste="this.value=this.value.replace(/[^\x00-\xff]/g,'')" /></td>
              </tr>
            </table>
            
            <table width="88%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="16%" height="35" align="left">结算银行卡银行：</td>
                <td width="27%" align="left"><input class="dogmark" name="bank" value="<?php echo $bank; ?>" type="text" size="20" /></td>
                <td width="7%" align="left">卡号：</td>
                <td width="50%" align="left"><input class="dogmark" name="bank_card" value="<?php echo $bank_card; ?>" type="text" size="30" 
                 onkeyup="this.value=this.value.replace(/[^\x00-\xff]/g,'')" onafterpaste="this.value=this.value.replace(/[^\x00-\xff]/g,'')" /></td>
              </tr>
            </table>
            <table width="88%" border="0" cellspacing="0" cellpadding="0">
              <tr align='left'>
            	<td height="35" width='100px'>&nbsp;&nbsp;&nbsp;&nbsp;
            		<label>性别: <select name='sex'>
            				<option <?php if($sex == 'female') echo 'selected'; ?> value='female'>&nbsp;女</option>
            				<option <?php if($sex == 'male') echo 'selected'; ?> value='male'>&nbsp;男</option>
            			</select></label>
            	</td><td>&nbsp;</td>
              </tr>
              <tr align='left' >
              	<td height="35" width='120px'>&nbsp;&nbsp;&nbsp;&nbsp;
              		<label>年龄: <input class="dogmark" name='age' value="<?php echo $age; ?>" type='text' size='5' /></label></td>
              	<td><label><input type="checkbox" name="show_age" <?php if( !empty($show_age) ) echo 'checked'; ?> /> 公开年龄</label></td>
              </tr>
            </table>
            
            <!-- 省市二级联动 -->
            <table width="88%" border="0" cellspacing="0" cellpadding="0">
            	<tr height="35" align='left'>
            		<td>所在城市:  <select name="province" id="province" ></select>
            					   <select name="city" id="city"></select>
                          			<script type='text/javascript'>initPlace('<?php echo $province; ?>','<?php echo $city; ?>');</script>
            			</td>
            	</tr>
            </table>
         <table width="88%" border="0" cellspacing="0" cellpadding="0">
         	<tr align='left'><td height="35" valign='top' width="60px;">个人简介:</td>
         		<td><textarea class="dogmark" name="info" cols="40" rows="5" ><?php echo $info; ?></textarea>
         	</td></tr>
         </table>
         
         <!-- 照片 -->
		 <table width="88%" border="0" cellspacing="0" cellpadding="0">
         	<tr align='left'><td height="35" valign='top'>上传个人相片(200x150px):</td></tr>
         	<tr>
         		<td width="230px"><img src="images/ico04.gif" id="preview" /></td>
         		<td valign="top"><input type="hidden" name="MAX_FILE_SIZE" value="2000000" />
         			<input name="file" type="file" onchange="showpic(this);"  />
         		</td>
         	</tr>
         </table>
         	
<table width="50%" border="0" cellspacing="0" cellpadding="0"><tr><td height="41">&nbsp;</td></tr></table>
<table width="92%" border="0" cellspacing="0" cellpadding="0"><tr><td height="1" bgcolor="#eaeaea"></td></tr></table>
<table width="39%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td height="51" align="center">
                  <input type="submit" name="Submit" value=" 提交 " />
                </td>
                <td align="center"><input type="reset" name="Submit2" value=" 重置 " /></td>
              </tr>
            </table>
</form>
<script type="text/javascript">
//切换图片
function showpic(obj){
	if(obj.value==''){
		document.getElementById('preview').src="images/ico04.gif";
	}else if(obj){ 
		if(!obj.value.match(/.jpg|.gif|.png|.bmp/i)){alert('File type must be: .jpg, .gif, .bmp or .png !');return;} 
		var p = document.getElementById('preview');
		//ie
		if (window.navigator.userAgent.indexOf("MSIE")>=1){
			if(obj.files){ 
				p.src = dFile.files[0].getAsDataURL(); 
			}else if(obj.value.indexOf('\\') > -1 || obj.value.indexOf('\/') > -1){ 
				p.src = obj.value; 
			} 
		}
		//firefox
		else if(window.navigator.userAgent.indexOf("Firefox")>=1){
			if(obj.files) img = obj.files.item(0).getAsDataURL();
			else img = obj.value;
		    p.src=img;
		}
	}//END obj
}

//表单验证
function validateSeller(){
	var f = document.getElementById('actorForm');
	var p = document.getElementById('preview');
	
	if(f.name.value == ''){
		alert("请输入真实姓名！");
		f.name.focus(); f.name.select();
	}else if( !checkCard() ){
		f.id_card.focus(); f.id_card.select();
	}else if( f.address.value == ''){
		alert("请填写现居住地！");
		f.address.focus(); f.address.select();
	}else if( f.phone.value  == ''){
		alert("请填写您的联系电话！");
		f.phone.focus(); f.phone.select();
	}else if( f.uin.value == '' ){
		alert("请填写您的K秀账号！");
		f.uin.focus(); f.uin.select();
	}else if( f.qq.value.length < 5 ){
		alert("请正确填写您的QQ号！");
		f.qq.focus(); f.qq.select();
	}else if( f.bank.value == '' ){
		alert("请填写结算银行卡银行！");
		f.bank.focus(); f.bank.select();
	}else if( f.bank_card.value == '' ){
		alert("请填写银行卡号！");
		f.bank_card.focus(); f.bank_card.select();
	}else if( f.age.value == '' ){
		alert("请填写您的年龄, 别担心, 可以选择不公开它！");
		f.age.focus(); f.age.select();
	}else if( Number(f.age.value) > 80 ){
		alert("请出入正常的年龄, 别担心, 可以选择不公开它！");
		f.age.focus(); f.age.select();
	}else if( f.info.value.length < 20 ){
		alert("请输入至少20个字的个人简介！");
		f.info.focus(); f.info.select();
	}else{
		return true;
	}
	
	return false;
}
</script>
<?php endif; ?>
<?php $this->_endblock('contents'); ?>